package com.small.account.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.small.account.entity.AuPermission;
import com.common.basis.oauth.AuUser;
import com.small.account.mapper.AuPermissionMapper;
import com.small.account.mapper.AuUserMapper;
import com.small.account.service.IAuUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**

 * 服务实现类

 *
 * @author wangguochao
 * @since 2020-01-06
 */
@Service
public class AuUserServiceImpl extends ServiceImpl<AuUserMapper, AuUser> implements IAuUserService {
    @Resource
    private AuPermissionMapper auPermissionMapper;



    /**
     * 获取用户根据用户名
     * @param userName 账号
     * @return 用户
     */
    @Override
    public AuUser findUserByName(String userName) {
        QueryWrapper<AuUser> wrapper = new QueryWrapper<>();
        wrapper.lambda().eq(AuUser::getUserName, userName);
        return getOne(wrapper);
    }


}
